package dbobjects;

import dbreflection.tablemanagement.DOTable;
import dbreflection.tablemanagement.DOField;
import dbreflection.tablemanagement.DatabaseObject;

/**
 * Created by IntelliJ IDEA.
 * User: [J0k3r]
 * Date: 26.11.2008
 * Time: 14:28:56
 */
@DOTable(table = "db_object_param", pk = "id")
public class DBObjectParam extends DatabaseObject {
    @DOField(column = "id")
    private Integer id;
    @DOField(column = "db_object_template_id")
    private Integer templateId;
    @DOField(column = "db_object_param_value_type_id")
    private Integer valueTypeID;
    @DOField(column = "param_name")
    private String name;
    @DOField(column = "mandatory")
    private Integer mandatory;
    @DOField(column = "is_deleted")
    private Integer deleted;

    public DBObjectParam() {
        this.id = UNASSIGNEDINT;
        this.templateId = UNASSIGNEDINT;
        this.valueTypeID = UNASSIGNEDINT;
        this.name = UNASSIGNEDSTRING;
        this.mandatory = UNASSIGNEDINT;
        this.deleted = UNASSIGNEDINT;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Integer templateId) {
        this.templateId = templateId;
    }

    public Integer getValueTypeID() {
        return valueTypeID;
    }

    public void setValueTypeID(Integer valueTypeID) {
        this.valueTypeID = valueTypeID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getMandatory() {
        return mandatory;
    }

    public void setMandatory(Integer mandatory) {
        this.mandatory = mandatory;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public String toString() {
        return name + (mandatory.equals(1) ? " *" : "");
    }
}
